package com.ebiz.mockup.core
{
	import com.ebiz.mockup.component.WarmCell;
	
	import mx.core.IVisualElementContainer;
	
	import spark.components.VGroup;

	public class Warm
	{
		
		private static var _instance:Warm;
		
		public static function get instance():Warm{
			if(_instance==null){
				_instance = new Warm();
			}
			return _instance;
		}
		public static const NO_JOINT_IN_CELLS_TO_REMOVE_JOINT:String = "所选组件之间没有连接";
		public static const MORE_CELLS_TO_REMOVE_JOINT:String = "选择组件过多（请选择2或3个组件）";
		public static const LEASE_CELLS_TO_REMOVE_JOINT:String = "请选择要被删除连接的组件（请选择2或3个组件）";
		public static const NEED_2_CELLS:String = "请选择两个组件";
		public static const NEED_3_CELLS:String = "请选择三个组件";
		public static const NO_CELLS_TO_BE_REMOVE:String = "请选择要被删除的组件";
		public static const NO_CELLS_SELECTED:String = "请选择组件";
		public static const PLEASE_SELECT_FIRST_CELL:String = "请选择第一个要被连接的组件";
		public static const PLEASE_SELECT_OTHER_CELL:String = "请选择另一个要被连接的组件";
		public static const PLEASE_SELECT_SECOND_CELL:String = "请选择第二个要被连接的组件";
		public static const PLEASE_SELECT_THIRD_CELL:String = "请选择第三个要被连接的组件";
		public static const STAGE_NEED_2_CELLS:String = "请至少添加两个组件";
		public static const STAGE_NEED_3_CELLS:String = "请至少添加三个组件";
		public static const HAD_JOIN2:String = "组件之间已经有连接，请选择其他组件";
		public static const HAD_JOIN3:String = "组件之间已经有连接，请选择其他组件";
		
		public function Warm()
		{
		}
		
		public var container:VGroup;
		
		public function show($content:String):void{
			var $cell:WarmCell = new WarmCell();
			$cell.content = $content;
			if(container.numElements>5){
				container.removeElementAt(5);
			}
			for(var i:int=0;i<container.numElements;i++){
				(container.getElementAt(i) as WarmCell).dispose();
			}
			$cell.addToContainer(this.container);
		}
	}
}
